Image processing has been widely applied as computer technologies develop. Generally, texture memory is firstly applied for an image in the process of processing the image. The image is stored in the texture memory and then processed. If the values of the width and the height of an image texture are powers of 2, a computer graphics card can rapidly process the image.
An existing method for storing an image in texture memory generally includes: applying for texture memory for an image, the width of the texture memory being greater than or equal to the original image width and being a power of 2, the height of the texture memory being greater than or equal to the original image height and being a power of 2, and a minimum value being usually selected from an available range as the value of the power. For example, texture memory for an image having a size of 100 pixels×100 pixels has the size of 128 pixels×128 pixels. The image is stored in the texture memory which is applied for.
The conventional techniques have at least the following problems: In the existing method for storing an image in texture memory, the size of the texture memory is made to be greater than or equal to the height or width of the image and be a power of 2. In some cases, for example, for an image having a size of 65 pixels×65 pixels, the size of the texture memory needs to be 128 pixels×128 pixels in order to meet the requirement that the width and the height of the image texture are the powers of 2. The size of the texture memory is much greater than the actual size of the image. Therefore, the existing method for storing an image in texture memory may waste a large amount of memory capacity, and reduce the image processing speed.